package com.bjsxt.controller;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.bjsxt.domain.AccountDetail;
import com.bjsxt.domain.CashWithdrawals;
import com.bjsxt.model.R;
import com.bjsxt.service.AccountDetailService;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import springfox.documentation.annotations.ApiIgnore;

@RestController
@RequestMapping("/accountDetails")
public class AccountDetailController {


    @Autowired
    private AccountDetailService accountDetailService;


    @GetMapping("/records")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "current", value = "当前页"),
            @ApiImplicitParam(name = "size", value = "每页显示的条数"),
            @ApiImplicitParam(name = "coinId", value = "coinId"),
            @ApiImplicitParam(name = "userId", value = "用户的ID"),
            @ApiImplicitParam(name = "userName", value = "用户的名称"),
            @ApiImplicitParam(name = "mobile", value = "用户的手机号"),
            @ApiImplicitParam(name = "accountId", value = "账号id"),
            @ApiImplicitParam(name = "amountStart", value = "充值金额的最小值"),
            @ApiImplicitParam(name = "amountEnd", value = "充值金额的最小值"),
            @ApiImplicitParam(name = "startTime", value = "充值开始时间"),
            @ApiImplicitParam(name = "endTime", value = "充值结束时间"),
    })
    public R<Page<AccountDetail>> findByPage(  @ApiIgnore Page<AccountDetail> page,
                                               Long userId,Long coinId, String userName, String mobile,
                                               Long accountId, String amountStart, String amountEnd,
                                               String startTime, String endTime){
           Page<AccountDetail> pageData =   accountDetailService.findByPage(page,coinId,accountId,userId,userName,mobile,amountStart,amountEnd,startTime,endTime);
        return R.ok(pageData);
    }


}
